package com.ardan1.client.core;

import com.ardan1.client.editor.PersonEditor;
import com.ardan1.shared.Person;
import com.google.gwt.core.client.GWT;
import com.google.gwt.editor.client.SimpleBeanEditorDriver;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Widget;
import com.google.inject.Inject;
import com.gwtplatform.mvp.client.ViewImpl;

public class TestEditorView extends ViewImpl implements TestEditorPresenter.MyView {

	private final Widget widget;
	
	@UiField
	PersonEditor personEditor;

	public interface Binder extends UiBinder<Widget, TestEditorView> {
	}

	// Empty interface declaration, similar to UiBinder
	interface Driver extends SimpleBeanEditorDriver<Person, PersonEditor> {
	}

	// Create the Driver
	Driver driver = GWT.create(Driver.class);

	@Inject
	public TestEditorView(final Binder binder) {
		widget = binder.createAndBindUi(this);
	}

	@Override
	public Widget asWidget() {
		return widget;
	}
	
	public Driver getDriver() {
		return driver;
	}
	
	public PersonEditor getPersonEditor() {
		return personEditor;
	}

}
